package com.agileai.crm.module.mytasks.handler;

import com.agileai.crm.module.mytasks.service.FollowUpManage;
import com.agileai.domain.DataParam;
import com.agileai.hotweb.controller.core.MasterSubEditPboxHandler;
import com.agileai.hotweb.domain.FormSelectFactory;
import com.agileai.util.StringUtil;

public class MyCustVisitInfoHandler
        extends MasterSubEditPboxHandler {
    public MyCustVisitInfoHandler() {
        super();
        this.serviceId = buildServiceId(FollowUpManage.class);
        this.subTableId = "MyCustVisitInfo";
    }

    protected void processPageAttributes(DataParam param) {
        if (!StringUtil.isNullOrEmpty(param.get("TASK_ID"))) {
            this.setAttribute("TASK_ID", param.get("TASK_ID"));
        }
        setAttribute("PROCUST_VISIT_EFFECT",
                FormSelectFactory.create("VISIT_EFFECT")
                                 .addSelectedValue(getOperaAttributeValue("PROCUST_VISIT_EFFECT",
                                                                          "")));
	    setAttribute("PROCUST_VISIT_TYPE",
	           FormSelectFactory.create("VISIT_TYPE")
	                            .addSelectedValue(getOperaAttributeValue("PROCUST_VISIT_TYPE",
	                                                                     "")));
    }

    protected FollowUpManage getService() {
        return (FollowUpManage) this.lookupService(this.getServiceId());
    }
}
